/**
 * Copyright (c) 2014 zhenrongbao.com, Inc. All Rights Reserved
 * @author: jiangshuguang
 * @Date  : 14-11-14
 * @Time  : 下午3:11
 * @brief :
 */
exports.guide = function(){
   var $widget = $(".widget-guide"),
       $tip = $widget.find('.tip'),
       $phone = $widget.find('.phone');

    function tipShow(text){
        $tip.css("visibility","visible").text(text);
    }

    function checkPhone(phone){
        return /^\d{11}$/.test($.trim(phone));
    }

    $widget.find('.btn').click(function(){
        var username = $phone.val();
        if(checkPhone(username)){
            location.href="/account/register?phone="+username
        }else{
            tipShow("请输入有效的手机号码");
        }
    });
};